//
//  CommendDetailListCell.m
//  meiyinxiang
//
//  Created by 媒印象 on 2018/1/10.
//  Copyright © 2018年 hbjApple. All rights reserved.
//

#import "CommendDetailListCell.h"
@interface CommendDetailListCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *userNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@property (weak, nonatomic) IBOutlet UILabel *commentContentLabel;
@end
@implementation CommendDetailListCell
+ (CommendDetailListCell *)loadNib{
  UINib *nib =   [UINib nibWithNibName:@"CommendDetailListCell" bundle:[NSBundle mainBundle]];
    return [[nib instantiateWithOwner:nil options:nil] lastObject];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setCommentViewModel:(CommentViewModel *)commentViewModel{
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:commentViewModel.userface] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
        if (image) {
            self.iconImageView.image = image;
        }else{
            self.iconImageView.image = [UIImage imageNamed:@"defual_luckyImg"];
            
            //self.iconImageViwe.image = [UIImage imageNamed:@"defual_luckyImg"];
        }    }];
    self.iconImageView.layer.cornerRadius = 17;
    self.iconImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.iconImageView.clipsToBounds = YES;
    self.userNameLabel.text = commentViewModel.username;
    self.timeLabel.text = commentViewModel.create_time;
    self.commentContentLabel.text = commentViewModel.content;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
